/**
 * Copyright (c) 2008 Trent Hoeppner
 * 
 * This file is part of BillCalc.
 * 
 * BillCalc is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * BillCalc is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with BillCalc.  If not, see <http://www.gnu.org/licenses/>.
 **/

package com.trentech.billcalc.event;

import java.util.Date;

import com.trentech.billcalc.FinanceManager;

/**
 * BillEvent represents when a bill becomes due for the residents of the 
 * apartment.
 */
public class BillEvent extends MoneyEvent {

    /**
     * Constructor for BillEvent.
     * 
     * @param   date    the date that the bill is due.  Cannot be null.
     * @param   name    the name of the biller who is owed money.  Cannot 
     *                  be null or empty.
     * @param   amount  the amount of money that the biller should be paid.
     *                  Must be >= 0.
     */
    public BillEvent(Date date, String name, int amount) {
        super(date, name, amount);
    }


    /**
     * Splits the bill between all residents that were living in the
     * apartment between when the last bill was due and the current bill is 
     * due.
     * 
     * @param   manager the FinancialManager to help process this Event.  
     *                  Cannot be null.
     */
    public void process(FinanceManager manager) {
        manager.billArrived(getName(), getDate(), getAmount());
    }
}
